// Tierless
// Copyright © 2010 Alphora
// This file is licensed under a modified BSD-license (see tierless_license.txt).
using System;
using System.Runtime.Serialization;

namespace Tierless.Framework.ServiceContracts
{
	/// <summary>
	/// Defines the fault contract for all service operations in the Tierless API.
	/// </summary>
	[DataContract(Namespace = "http://Tierless.Framework.ServiceContracts/2010/08", Name = "TierlessFaultContract")]
	public class TierlessFault
	{
		/// <summary>
		/// Initializes a new instance of the TierlessFault class.
		/// </summary>
		public TierlessFault() : this(String.Empty) {}

		/// <summary>
		/// Initializes a new instance of the TierlessFault class with the given error message.
		/// </summary>
		/// <param name="errorMessage">The error message for the fault.</param>
		public TierlessFault(string errorMessage)
		{
			ErrorMessage = errorMessage;
		}

		/// <summary>
		/// Gets or sets the error message for the fault.
		/// </summary>
		[DataMember(IsRequired = true, Name = "ErrorMessage", Order = 1)]
		public string ErrorMessage { get; set; }
	}
}